package main

import "fmt"

func main() {
	candyType := []int{1, 1, 2, 2, 3, 3}
	fmt.Println(distributeCandies(candyType))
}

//#link: https://leetcode-cn.com/problems/distribute-candies/
func distributeCandies(candyType []int) int {
	tmpMap := make(map[int]int)
	for _, t := range candyType {
		tmpMap[t]++
	}
	if len(tmpMap) <= len(candyType)/2 {
		return len(tmpMap)
	} else {
		return len(candyType) / 2
	}
}
